home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / cat3 / ConfigWind.3 < prev    next >
Text File  |  1994-09-20  |  13KB  |  331 lines

  1.  
  2.  
  3.  
  4. Tk_ConfigureWindow(3) Tk Library Procedures                   3.3
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      Tk_ConfigureWindow, Tk_MoveWindow, Tk_ResizeWindow,
  12.      Tk_MoveResizeWindow, Tk_SetWindowBorderWidth
  13.      Tk_ChangeWindowAttributes, Tk_SetWindowBackground,
  14.      Tk_SetWindowBackgroundPixmap, Tk_SetWindowBorder,
  15.      Tk_SetWindowBorderPixmap, Tk_SetWindowColormap,
  16.      Tk_DefineCursor, Tk_UndefineCursor - change window confi-
  17.      guration or attributes
  18.  
  19. SYNOPSIS
  20.      #include <tk.h>
  21.  
  22.      Tk_ConfigureWindow(_t_k_w_i_n, _v_a_l_u_e_M_a_s_k, _v_a_l_u_e_P_t_r)
  23.  
  24.      Tk_MoveWindow(_t_k_w_i_n, _x, _y)
  25.  
  26.      Tk_ResizeWindow(_t_k_w_i_n, _w_i_d_t_h, _h_e_i_g_h_t)
  27.  
  28.      Tk_MoveResizeWindow(_t_k_w_i_n, _x,  _y, _w_i_d_t_h, _h_e_i_g_h_t)
  29.  
  30.      Tk_SetWindowBorderWidth(_t_k_w_i_n, _b_o_r_d_e_r_W_i_d_t_h)
  31.  
  32.      Tk_ChangeWindowAttributes(_t_k_w_i_n, _v_a_l_u_e_M_a_s_k, _a_t_t_s_P_t_r)
  33.  
  34.      Tk_SetWindowBackground(_t_k_w_i_n, _p_i_x_e_l)
  35.  
  36.      Tk_SetWindowBackgroundPixmap(_t_k_w_i_n, _p_i_x_m_a_p)
  37.  
  38.      Tk_SetWindowBorder(_t_k_w_i_n, _p_i_x_e_l)
  39.  
  40.      Tk_SetWindowBorderPixmap(_t_k_w_i_n, _p_i_x_m_a_p)
  41.  
  42.      Tk_SetWindowColormap(_t_k_w_i_n, _c_o_l_o_r_m_a_p)                         |
  43.  
  44.      Tk_DefineCursor(_t_k_w_i_n, _c_u_r_s_o_r)                                |
  45.  
  46.      Tk_UndefineCursor(_t_k_w_i_n)                                      |
  47.  
  48. ARGUMENTS
  49.      Tk_Window              _t_k_w_i_n         (in)      Token     for
  50.                                                     window.
  51.  
  52.      unsigned int           _v_a_l_u_e_M_a_s_k     (in)      OR-ed mask of
  53.                                                     values   like
  54.                                                     CWX or CWBor-
  55.                                                     derPixel,
  56.                                                     indicating
  57.                                                     which  fields
  58.                                                     of  *_v_a_l_u_e_P_t_r
  59.                                                     or   *_a_t_t_s_P_t_r
  60.  
  61.  
  62.  
  63. Tk                                                              1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Tk_ConfigureWindow(3) Tk Library Procedures                   3.3
  71.  
  72.  
  73.  
  74.                                                     to use.
  75.  
  76.      XWindowChanges         *_v_a_l_u_e_P_t_r     (in)      Points  to  a
  77.                                                     structure
  78.                                                     containing
  79.                                                     new    values
  80.                                                     for the  con-
  81.                                                     figuration
  82.                                                     parameters
  83.                                                     selected   by
  84.                                                     _v_a_l_u_e_M_a_s_k.
  85.                                                     Fields    not
  86.                                                     selected   by
  87.                                                     _v_a_l_u_e_M_a_s_k are
  88.                                                     ignored.
  89.  
  90.      int                    _x             (in)      New        x-
  91.                                                     coordinate
  92.                                                     for   _t_k_w_i_n's
  93.                                                     top      left
  94.                                                     pixel
  95.                                                     (including
  96.                                                     border,    if
  97.                                                     any)   within
  98.                                                     tkwin's
  99.                                                     parent.
  100.  
  101.      int                    _y             (in)      New        y-
  102.                                                     coordinate
  103.                                                     for   _t_k_w_i_n's
  104.                                                     top      left
  105.                                                     pixel
  106.                                                     (including
  107.                                                     border,    if
  108.                                                     any)   within
  109.                                                     tkwin's
  110.                                                     parent.
  111.  
  112.      unsigned int           _w_i_d_t_h         (in)      New width for
  113.                                                     _t_k_w_i_n  (inte-
  114.                                                     rior,     not
  115.                                                     including
  116.                                                     border).
  117.  
  118.      unsigned int           _h_e_i_g_h_t        (in)      New    height
  119.                                                     for     _t_k_w_i_n
  120.                                                     (interior,
  121.                                                     not including
  122.                                                     border).
  123.  
  124.      unsigned int           _b_o_r_d_e_r_W_i_d_t_h   (in)      New width for
  125.                                                     _t_k_w_i_n's
  126.  
  127.  
  128.  
  129. Tk                                                              2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. Tk_ConfigureWindow(3) Tk Library Procedures                   3.3
  137.  
  138.  
  139.  
  140.                                                     border.
  141.  
  142.      XSetWindowAttributes   *_a_t_t_s_P_t_r      (in)      Points  to  a
  143.                                                     structure
  144.                                                     containing
  145.                                                     new    values
  146.                                                     for       the
  147.                                                     attributes
  148.                                                     given by  the
  149.                                                     _v_a_l_u_e_M_a_s_k
  150.                                                     argument.
  151.                                                     Attributes
  152.                                                     not  selected
  153.                                                     by  _v_a_l_u_e_M_a_s_k
  154.                                                     are ignored.
  155.  
  156.      unsigned long          _p_i_x_e_l         (in)      New     back-
  157.                                                     ground     or
  158.                                                     border  color
  159.                                                     for window.
  160.  
  161.      Pixmap                 _p_i_x_m_a_p        (in)      New pixmap to
  162.                                                     use for back-
  163.                                                     ground     or
  164.                                                     border     of
  165.                                                     _t_k_w_i_n.  WARN-
  166.                                                     ING:   cannot
  167.                                                     necessarily
  168.                                                     be    deleted
  169.                                                     immediately,
  170.                                                     as  for  Xlib
  171.                                                     calls.    See
  172.                                                     note below.
  173.  
  174.      Colormap               _c_o_l_o_r_m_a_p      (in)      New  colormap  |
  175.                                                     to   use  for  |
  176.                                                     _t_k_w_i_n.         |
  177.  
  178.      Cursor                 _c_u_r_s_o_r        (in)                          ||
  179.                                                     New cursor to  |
  180.                                                     use       for  |
  181.                                                     _t_k_w_i_n.     If  |
  182.                                                     None       is  |
  183.                                                     specified,  |
  184.                                                     then    _t_k_w_i_n  |
  185.                                                     will not have  |
  186.                                                     its own  cur-  |
  187.                                                     sor;  it will  |
  188.                                                     use the  cur-  |
  189.                                                     sor   of  its  |
  190.                                                     parent.
  191. _________________________________________________________________
  192.  
  193.  
  194.  
  195. Tk                                                              3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. Tk_ConfigureWindow(3) Tk Library Procedures                   3.3
  203.  
  204.  
  205.  
  206. DESCRIPTION
  207.      These procedures are analogous to the X  library  procedures
  208.      with  similar  names, such as XConfigureWindow.  Each one of
  209.      the above procedures calls the corresponding X procedure and
  210.      also  saves  the  configuration  information  in  Tk's local
  211.      structure for the window.  This allows the information to be
  212.      retrieved  quickly  by the application (using macros such as
  213.      Tk_X and Tk_Height) without having to contact the X  server.
  214.      In  addition,  if  no X window has actually been created for
  215.      _t_k_w_i_n yet, these procedures do not  issue  X  operations  or
  216.      cause  event handlers to be invoked;  they save the informa-
  217.      tion in Tk's local structure for the window;  when the  win-
  218.      dow  is created later, the saved information will be used to
  219.      configure the window.
  220.  
  221.      See the X library documentation for details  on  what  these
  222.      procedures do and how they use their arguments.
  223.  
  224.      In   the   procedures   Tk_ConfigureWindow,   Tk_MoveWindow,
  225.      Tk_ResizeWindow,           Tk_MoveResizeWindow,          and
  226.      Tk_SetWindowBorderWidth, if _t_k_w_i_n is an internal window then
  227.      event  handlers  interested  in configure events are invoked
  228.      immediately, before the procedure returns.  If _t_k_w_i_n isn't a
  229.      top-level  window  then  the  event handlers will be invoked
  230.      later, after X has seen the request and  returned  an  event
  231.      for it.
  232.  
  233.      Applications using Tk  should  never  call  procedures  like
  234.      XConfigureWindow  directly;   they  should  always  use  the
  235.      corresponding Tk procedures.
  236.  
  237.      The size and location of a window should only be modified by  |
  238.      the  appropriate  geometry manager for that window and never  |
  239.      by a window itself (but see Tk_MoveToplevelWindow for moving  |
  240.      a top-level window).
  241.  
  242.      It is not allowable to use Tk_ConfigureWindow to change  the  |
  243.      stacking  order  of  a window (_v_a_l_u_e_M_a_s_k may not contain the  |
  244.      CWSibling or CWStackMode  bits).   To  change  the  stacking  |
  245.      order, use the procedure Tk_RestackWindow.
  246.  
  247.  
  248. BUGS
  249.      Tk_SetWindowBackgroundPixmap  and   Tk_SetWindowBorderPixmap
  250.      differ  slightly  from  their  Xlib counterparts in that the
  251.      _p_i_x_m_a_p argument may not necessarily be  deleted  immediately
  252.      after  calling  one  of  these  procedures.  This is because
  253.      _t_k_w_i_n's window may not exist yet at the time of the call, in
  254.      which  case  _p_i_x_m_a_p  is  merely  saved  and  used later when
  255.      _t_k_w_i_n's window is actually created.  If you wish  to  delete
  256.      _p_i_x_m_a_p,  then  call Tk_MakeWindowExist first to be sure that
  257.      _t_k_w_i_n's window exists and _p_i_x_m_a_p has been passed  to  the  X
  258.  
  259.  
  260.  
  261. Tk                                                              4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. Tk_ConfigureWindow(3) Tk Library Procedures                   3.3
  269.  
  270.  
  271.  
  272.      server.
  273.  
  274.      A similar problem occurs for the _c_u_r_s_o_r argument  passed  to  |
  275.      Tk_DefineCursor.   The  solution  is the same as for pixmaps  |
  276.      above: call Tk_MakeWindowExist before freeing the cursor.
  277.  
  278.  
  279. SEE ALSO
  280.      Tk_MoveToplevelWindow, Tk_RestackWindow
  281.  
  282.  
  283. KEYWORDS
  284.      attributes, border, color, configure, height, pixel, pixmap,
  285.      width, window, x, y
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327. Tk                                                              5
  328.  
  329.  
  330.  
  331.